package cn.sc.allinpay.allfavour.business.paymentresult;

import android.os.Bundle;
import android.support.v7.widget.AppCompatButton;
import android.support.v7.widget.AppCompatTextView;
import android.view.View;

import butterknife.BindView;
import butterknife.OnClick;
import cn.sc.allinpay.allfavour.R;
import cn.sc.allinpay.allfavour.base.activity.BaseActivity;


/**
 * activity 去支付
 * author：pany
 * on 2017/12/1 11:14
 */
public class PaymentResultActivity extends BaseActivity<PaymentResultContract.View, PaymentResultContract.Presenter>
        implements PaymentResultContract.View {

    @BindView(R.id.tvOrderId)
    AppCompatTextView tvOrderId;//订单号
    @BindView(R.id.tvOrderStatus)
    AppCompatTextView tvOrderStatus;//订单状态
    @BindView(R.id.btnBack)
    AppCompatButton btnBack;//扫码

    @Override
    protected int layoutId() {
        return R.layout.activity_payment_result;
    }

    @Override
    protected void layoutTitle(View top, AppCompatTextView left, AppCompatTextView title, AppCompatTextView right) {
        title.setText("支付结果");
        left.setVisibility(View.GONE);
    }

    @Override
    protected PaymentResultContract.Presenter bindPresenter() {
        return new PaymentResultPresenter();
    }

    @Override
    protected void layoutContent(Bundle savedInstanceState) {

    }

    @Override
    public void showOrderId(String data) {
        tvOrderId.setText(data);
    }

    @Override
    public void showHomeBtn(int visible) {
        btnBack.setVisibility(visible);
    }

    @Override
    public void showOrderStatus(String data) {
        tvOrderStatus.setText(data);
    }

    @OnClick({ R.id.btnBack})
    void btnClick(View view) {
        switch (view.getId()) {
            case R.id.btnBack:
                presenter.goHme();
                break;
        }
    }

    @Override
    public void onBackPressed() {
        presenter.goHme();
    }
}
